package controller.contactUs;

import java.io.Serializable;

import javax.faces.bean.ManagedBean;
import javax.faces.bean.SessionScoped;

import persistence.TenantDAO;
import dto.contactUs.TenantDTO;
import entity.Tenant;

@ManagedBean(name = "contactUsController")
@SessionScoped
public class ContactUsController implements Serializable {

	private static final long serialVersionUID = 8952686286267789817L;

	public TenantDTO getDetails(TenantDTO tenantDTO) throws Exception {
		TenantDAO dao = new TenantDAO();
		Tenant tenant = dao.findById(tenantDTO.getName());
		tenantDTO.setActive(tenant.getActive());
		tenantDTO.setAddress(tenant.getAddress());
		tenantDTO.setDescription(tenant.getDescription());
		tenantDTO.setId(tenant.getId());
		tenantDTO.setLatitude(tenant.getLatitude());
		tenantDTO.setLongitude(tenant.getLongitude());
		tenantDTO.setName(tenant.getName());
		tenantDTO.setReccrtts(tenant.getReccrtts());
		tenantDTO.setReclstupdatets(tenant.getReclstupdatets());
		return tenantDTO;
	}
}
